Memory-aware matrix factorization

ABSTRACT

Embodiments include method, systems and computer program products for performing memory-aware matrix factorization on a graphics processing unit. Aspects include determining one or more types of memory on the graphics processing unit and determining one or more characteristics of each of the one or more types of memory. Aspects also include assigning each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics and executing the matrix factorization algorithm on the graphics processing unit.

BACKGROUND

The present disclosure relates to matrix factorization and more specifically, to methods, systems and computer program products for performing memory-aware matrix factorization.

Recommendation systems are becoming more and more pervasive in Internet applications such as music sharing, e-commerce, and on-demand Internet streaming media. Moreover, recommendation systems can be combined with other applications, like ranking and filtering, to develop new products in online advertisement and user-centric information retrieval. A common technique used in recommendation systems is the factorization of a user-item matrix R, whose entries at (u; v) denote a preference of user u on item v. This user-item matrix R is generally a sparse matrix and matrix factorization is used to generate estimated entries for the entries that have null, or zero values. A matrix-factorization based collaborative filter is generally considered one of the best models for recommendation systems.

The problem of matrix factorization is to decompose matrix R into two dense matrixes X and Θ, such that: R≈X·Θ^(T). Assuming that r_(u,v) is an non-zero element of matrix R at position (u; v), the matrix factorization can be accomplished by the minimization of the following cost function:

$\begin{matrix} {J = {{\sum\limits_{{u,v}\;}^{\;}\left( {r_{u,v} - {X_{u}^{T}\theta_{v}}} \right)^{2}} + {\lambda\left( {{\sum\limits_{u}^{\;}{n_{x_{u}}{X_{u}}^{2}}} + {\sum\limits_{v}^{\;}{n_{\theta_{v}}{\theta_{v}}^{2}}}} \right)}}} & (1) \end{matrix}$

where x^(T) _(u) and Θ_(v) are the uth row of X and the with column of Θ^(T), respectively.

The optimization of the above cost function (1) can be done through many classical optimization methods, including alternative least square, coordinate descent and stochastic gradient descent have been applied to solve this problem. The nature of matrix factorization is computation expensive and accordingly, for real-life, industry-scale matrix factorization problems, parallel computing is often used. Parallelizing the optimization problem of matrix factorization is difficult because many classical algorithms for matrix factorization are sequential instead of parallel. There have been a lot of efforts in applying parallel computing methods for matrix factorization, especially in the scenario of shared memory, CPU-based systems. However, such methods suffer from locking, discontinuous memory access and memory hotspots.

SUMMARY

In accordance with an embodiment, a method for performing memory-aware matrix factorization is provided. Aspects include determining one or more types of memory on the graphics processing unit and determining one or more characteristics of each of the one or more types of memory. Aspects also include assigning each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics and executing the matrix factorization algorithm on the graphics processing unit.

In accordance with another embodiment, a graphics processing unit for performing memory-aware matrix factorization includes a processor configured to perform a method. Aspects include determining one or more types of memory on the graphics processing unit and determining one or more characteristics of each of the one or more types of memory. Aspects also include assigning each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics and executing the matrix factorization algorithm on the graphics processing unit.

In accordance with a further embodiment, a computer program product for performing memory-aware matrix factorization includes a non-transitory storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method. Aspects include determining one or more types of memory on the graphics processing unit and determining one or more characteristics of each of the one or more types of memory. Aspects also include assigning each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics and executing the matrix factorization algorithm on the graphics processing unit.

BRIEF DESCRIPTION OF THE DRAWINGS

The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The forgoing and other features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:

FIG. 1 is a block diagram illustrating one example of a processing system for practice of the teachings herein;

FIG. 2 is a block diagrams illustrating a graphics processing unit in accordance with exemplary embodiments;

FIG. 3A is an alternating least square (ALS) algorithm for performing matrix factorization;

FIG. 3B is an alternating least square (ALS) algorithm for performing memory-aware matrix factorization in accordance with an exemplary embodiment;

FIG. 4 is a flow diagram of a method for performing memory-aware matrix factorization in accordance with an exemplary embodiment.

DETAILED DESCRIPTION

In accordance with exemplary embodiments of the disclosure, methods, systems and computer program products for performing memory-aware matrix factorization are provided. In exemplary embodiments, a method for executing a matrix factorization algorithm on a graphics processing unit includes determining available types of memory on the graphics processing unit and one or more characteristics for each type of available memory. The method also includes assigning the storage of each variable used by the matrix factorization algorithm to one of the available types of memory based on the characteristics for each type of available memory. In exemplary embodiments, the performance of the graphics processing unit in executing the matrix factorization algorithm is improved by assigning the storage of each variable used by the matrix factorization algorithm to one of the available types of memory based on the characteristics for each type of available memory. In exemplary embodiments, the matrix factorization algorithm is an alternating least square (ALS) algorithm.

In exemplary embodiments, by storing each of the variables used by a matrix factorization algorithm to a type of memory based on the characteristics of the memory, the memory accesses of the matrix factorization algorithm can be optimized. The optimization can include reducing discontiguous memory access and/or caching hotspot, or frequently accessed variables. For example, the optimization of the memory access can include transforming discontiguous memory accesses to contiguous memory accesses, and allocating faster memory to hotspot variables. As a result, the performance of the graphics processing unit, and by extension the computer system having the graphics processing unit, in executing the matrix factorization algorithm is improved.

Referring to FIG. 1, there is shown an embodiment of a processing system 100 for implementing the teachings herein. In this embodiment, the system 100 has one or more central processing units (processors) 101 a, 101 b, 101 c, etc. (collectively or generically referred to as processor(s) 101). In one embodiment, each processor 101 may include a reduced instruction set computer (RISC) microprocessor. Processors 101 are coupled to system memory 114 and various other components via a system bus 113. Read only memory (ROM) 102 is coupled to the system bus 113 and may include a basic input/output system (BIOS), which controls certain basic functions of system 100.

FIG. 1 further depicts an input/output (I/O) adapter 107 and a network adapter 106 coupled to the system bus 113. I/O adapter 107 may be a small computer system interface (SCSI) adapter that communicates with a hard disk 103 and/or tape storage drive 105 or any other similar component. I/O adapter 107, hard disk 103, and tape storage device 105 are collectively referred to herein as mass storage 104. Operating system 120 for execution on the processing system 100 may be stored in mass storage 104. A network adapter 106 interconnects bus 113 with an outside network 116 enabling data processing system 100 to communicate with other such systems. A screen (e.g., a display monitor) 115 is connected to system bus 113 by display adaptor 112, which may include a graphics adapter to improve the performance of graphics intensive applications and a video controller. In one embodiment, adapters 107, 106, and 112 may be connected to one or more I/O busses that are connected to system bus 113 via an intermediate bus bridge (not shown). Suitable I/O buses for connecting peripheral devices such as hard disk controllers, network adapters, and graphics adapters typically include common protocols, such as the Peripheral Component Interconnect (PCI). Additional input/output devices are shown as connected to system bus 113 via user interface adapter 108 and display adapter 112. A keyboard 109, mouse 110, and speaker 111 all interconnected to bus 113 via user interface adapter 108, which may include, for example, a Super I/O chip integrating multiple device adapters into a single integrated circuit.

In exemplary embodiments, the processing system 100 includes a graphics processing unit 130. Graphics processing unit 130 is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display. In general, graphics processing unit 130 is very efficient at manipulating computer graphics and image processing, and has a highly parallel structure that makes it more effective than general-purpose CPUs for algorithms where processing of large blocks of data is done in parallel.

Thus, as configured in FIG. 1, the system 100 includes processing capability in the form of processors 101, storage capability including system memory 114 and mass storage 104, input means such as keyboard 109 and mouse 110, and output capability including speaker 111 and display 115. In one embodiment, a portion of system memory 114 and mass storage 104 collectively store an operating system such as the AIX® operating system from IBM Corporation to coordinate the functions of the various components shown in FIG. 1.

Referring now to FIG. 2, a graphics processing unit 200 is illustrated. The graphics processing unit 200 includes one or more processors 202 that each include a plurality of registers 204. The graphics processing unit 200 also includes a shared memory 206, which may also be embodied in a cache memory. In exemplary embodiments, the access latency for the shared memory 206 is greater than the access latency for the registers 204, but is less than other memory types available to the processors 202. The graphics processing unit 200 also includes a texture memory 208, which is a read-only memory which may be embodied in a cache memory. In exemplary embodiments, the access latency for the texture memory 208 is greater than the access latency for the registers 204 and the shared memory 206, but is less than other memory types. The graphics processing unit 200 also includes a global memory 210, which may be embodied in a DRAM or other suitable type of memory. In exemplary embodiments, the access latency for the global memory 208 is greater than the access latency for the registers 204, the shared memory 206 and the texture memory 208. In exemplary embodiments, the texture memory 208 can be used to store cached entries from a global memory 210. In exemplary embodiments, the global memory 210 is relatively slow, the texture memory 208 is read only, and the register 204 and shared memory 206 are not visible across kernels (i.e., GPU device functions).

In general, the implementation of matrix factorization algorithm on a graphics processing unit 200 is more complex than implementing the matrix factorization algorithm on a general processor or CPU. One reason is due to the lower clock frequency (e.g., 850 Hz) of a graphics processing unit 200 than CPU (e.g., 2 GHz). Another reason is that the graphics processing unit 200 typically includes less memory (e.g. 4-12 GB) than a CPU (e.g., 32-256 GB). In addition, the control of registers, shared and texture memory is not as easily performed in a graphics processing unit 200 as it is in a CPU. This is because the compilers on GPUs are less powerful in automatically managing a complex memory hierarchy, and as a consequence GPU programmers have to make more explicit control of the memory hierarchy.

One approach to optimize the non-convex cost function in (1) is to iteratively optimize X while fixing Θ, and then optimize Θ while fixing X. Consider:

$\frac{\partial J}{\partial X_{u}} = 0$ $\frac{\partial J}{\partial\theta_{v}} = 0$

Which leads to the following equation:

$\begin{matrix} {{X_{u} \cdot {\sum\limits_{r_{uv} \neq 0}^{\;}\left( {{\theta_{v}\theta_{v}^{T}} + {\lambda \; I}} \right)}} = {\Theta^{T} \cdot \left\lbrack {R\left( {u,\text{:}} \right)} \right\rbrack^{T}}} & (2) \end{matrix}$

together with:

$\begin{matrix} {{\theta_{v} \cdot {\sum\limits_{r_{uv} \neq 0}^{\;}\left( {{X_{u}X_{u}^{T}} + {\lambda \; I}} \right)}} = {X^{T} \cdot {R\left( {\text{:},v} \right)}}} & (3) \end{matrix}$

which is known as the alternating least squares (ALS) method. As used herein, λ is a user-provided real number for regularization purpose; I is an identity matrix of dimension f (f is the number of columns of X).

The computational cost of executing the ALS method can be analyzed by the following solution as a representation to update x_(u) and Θ_(v):

$\begin{matrix} {{{X_{u} = {\left\lbrack {\sum\limits_{r_{uv} \neq 0}^{\;}\left( {{\theta_{v}\theta_{v}^{T}} + {\lambda \; I}} \right)} \right\rbrack^{- 1} = {\Theta^{T}\left\lbrack {R\left( {u,\text{:}} \right)} \right\rbrack}^{T}}},{{{for}\mspace{14mu} u} = 1},2,{\ldots \mspace{14mu} m}}{{{\theta_{v} \cdot \left\lbrack {\sum\limits_{r_{uv} \neq 0}^{\;}\left( {{X_{u}X_{u}^{T}} + {\lambda \; I}} \right)} \right\rbrack^{- 1}} = {X^{T}{R\left( {\text{:},v} \right)}}},{{{for}\mspace{14mu} v} = 1},2,{\ldots \mspace{14mu} n}}} & (4) \end{matrix}$

where m is the number of users and n is the number of items.

As can be seen in Eq. (4), X and Θ are updated alternatively and iteratively, while the update of each x_(u) and Θ_(v) are independent of each other, respectively. Eq. (4)'s memory access comes in several aspects including: accessing a row R(u; :) or a column R(: ; v) from the user-item matrix R; accessing collection of columns Θ_(v) subject to r_(u;v)≠0 for every u; and accessing collection of rows x^(T) _(u) subject to r_(u;v)≠0 for every v; aggregating many Θ_(v)·Θ_(v) ^(T) for every u; and aggregating many x_(u)·x^(T) _(u) for every v.

In each iteration of Eq. (4) to solve for X and Θ, a certain row or column of R needs to be accessed only once. In contrast, in each iteration, to solve for a single x_(u), a Σ_(v) 1 r_(u;v≠0) number of columns spread discontiguously across the many columns in Θ^(T) need to be accessed. For example, in a sample data set, assume on average one user rates 200+ items; this leads to a discontiguous access of 200+Θ_(v) columns among the total 17,770 columns in Θ^(T). Similarly, to solve for a single Θ_(v), a Σ_(u) 1 r_(u;v≠0) number of rows of X need to be accessed.

In addition, according to Eq. (4), solving for one x_(u) requires computing and aggregating Θ_(v)·Θ_(v) ^(T). Therefore, each element in column vector Θ_(v) is accessed frequently, and the aggregation updated frequently. Suppose the dimensionality of Θ_(v) is f, then to compute Θ_(v)·Θ_(v) ^(T), each element of Θ_(v) will be read f times and to add Θ_(v)·Θ_(v) ^(T) to Σr_(u;v≠0) (Θ_(v)·Θ_(v) ^(T)+λI) will require f² writes. Table 1 compares the cost from these three types of memory accesses.

TABLE I THE MEMORY ACCESS COST FROM DIFFERENT COMPUTATIONS, IN EACH ALS ITERATION. Number of access per Target row/column, and per iteration R(u, :) 1 R(:, v) 1 all θ_(v)θ_(v) ^(T) for a x_(u) Σ_(v)1_(r) _(u,v) _(≠ 0) · f all x_(u)x_(u) ^(T) for a θ_(v) Σ_(u)1_(r) _(u,v) _(≠ 0) · f $\sum\limits_{r_{uv} \neq 0}\; {\theta_{v}\theta_{v}^{T}\mspace{14mu} {for}\mspace{14mu} a\mspace{14mu} x_{u}}$ Σ_(v)1_(r) _(u,v) _(≠ 0) · f² $\sum\limits_{r_{uv} \neq 0}\; {x_{u}x_{u}^{T}\mspace{14mu} {for}\mspace{14mu} a\mspace{14mu} \theta_{u}}$ Σ_(u)1_(r) _(u,v) _(≠ 0) · f²

In exemplary embodiments, a method for performing memory aware matrix factorization reduces the cost of memory access. In exemplary embodiments, the number of memory access may not be reduced from traditional matrix factorization. However, the method for performing memory aware matrix factorization transforms discontiguous memory accesses to contiguous memory accesses and allocates faster memory to hotspot variables to reduce the cost of the memory access.

In exemplary embodiments, a given column vector Θ_(v) is needed to update many x_(u)s as long as r_(u;v≠0). Therefore one Θ_(v) will be read Σ_(u) 1 r_(u;v≠0) many times and is worth storing in a cache memory. Also, updating a given column vector x_(u) requires many Θ_(v)s as long as r_(u;v)≠0. Accordingly, in exemplary embodiments, discontiguous memory accesses can be reduced by caching all needed Θ_(v)s in the memory space of x_(u) update, so that later computation on Θ_(v)s does not need to access the discontiguous memory again. In exemplary embodiments, memory accesses can further be optimized by caching hotspot variables. In one embodiment, the aggregation variable Σr_(u;v≠0) (Θ_(v)·Θ_(v) ^(T)+λI) is stored in register because it needs to be updated frequently, i.e., each time a Θ_(v)·Θ_(v) ^(T) is added in.

The challenge of implementing such changes to the memory accesses is that, in any computer architecture with a memory hierarchy, faster memory such as cache is a limited resource. Therefore, both the memory access patterns of the matrix factorization algorithm and the memory hierarchy, capacity and characteristics of a given computer hardware need to be considered. For example, all needed Θ_(v)s, and Σr_(u;v≠0) (Θ_(v)·Θ_(v) ^(T)+λI) for a single x_(u) may be too big to store in the cache memory of a graphics processing unit and therefore the computation and caching may need to be performed in stages. In exemplary embodiments, the memory aware method performing matrix factorization includes selecting Θ_(v) according to the constraint r_(u;v)≠0, which is different from the traditional dense matrix multiplication, and since there are many Θ_(v)·Θ_(v) ^(T) of executed in parallel, careful allocation of the multiple processors to utilize the limited cache is needed for efficient computing. FIG. 3B is an alternating least square (ALS) algorithm for performing memory-aware matrix factorization in accordance with an exemplary embodiment.

When running Algorithm 1, shown in FIG. 3A, it was observed that about 80% of the total execution time lies in computing A_(u), while generating B_(u) and solving the equations take about 20% of the total execution time. Accordingly, in order to efficiently compute A_(u), the memory accesses need to be optimized, as discussed in further detail below.

As shown in line 2, Algorithm 1 includes reading from Θ^(T)·Θ^(T) whose dimension is f×n, is stored in global memory. Accordingly, when collecting submatrix Θ_(u) ^(T) from Θ^(T), texture memory is used as cache because the collecting process enjoys spatial locality and because Θ^(T) is read-only, as is shown in line 2 of Algorithm 2. In addition, different Θ_(u) ^(T) can potentially re-use the same Θ_(v)s cached in texture memory. In exemplary embodiments, this caching step also reduces discontiguous memory access.

As shown in line 2, caching the read-only Θ^(T) in texture memory reduces the need for concurrency control since the data Θ^(T) will not be changed by any thread that accesses it. With this hint, the graphics processing unit can speed up the memory access.

As shown in line 2, Algorithm 1 includes storing Θ_(u) ^(T). In exemplary embodiments, one thread block consisting off threads is used to solve each x_(u), and the per-block shared memory is used to store Θ_(u) ^(T), so as to speed up the subsequent read in line 5. However, for each block, the whole Θ_(u) ^(T) is not copied into its shared memory space because Θ_(u) ^(T) is of size f×n_(xu) (recall that n_(xu) is the number of items user u has rated) and is too large compared to the shared memory. If a single thread block consumes a large portion of the limited shared memory, other blocks that cannot obtain the shared memory are prohibited from launching, resulting in low parallelism in the graphics processing unit. To achieve a higher parallelism and utilization, for each x_(u), instead of allocating an f×n_(xu) block, a bin size bin is selected and a block Θ_(u) ^(T) [bin] of size f×bin is allocated. In exemplary embodiments, a bin between 10 and 20 can be used, while n_(xu) can be hundreds or thousands. A subset of Θ_(u) ^(T) is iteratively moved into Θ_(u) ^(T) [bin] to be processed in the following step.

As shown in line 5, Algorithm 1 includes writing A_(u) by reading a Θ_(v) from Θ_(u) ^(T) [bin], calculating the f×f elements of Θ_(v) Θ_(v) ^(T), and adding them to global memory A_(u). Since A_(u) is a memory hotspot, it is stored in the register memory to partially aggregate

$\sum\limits_{\theta_{v\; \_} \in {\Theta_{u}^{T}{\lbrack{bin}\rbrack}}}^{\;}{\theta_{v}\theta_{v}^{T}}$

and only need to update global memory A_(u) after iterating over all columns in Θ_(u) ^(T) [bin]. In exemplary embodiments, storing A_(u) in the register memory reduces global memory access by a factor of n_(xu).

FIG. 3B illustrates an alternating least square (ALS) algorithm for performing memory-aware matrix factorization in accordance with an exemplary embodiments. As illustrated, each of the memory accesses of the algorithm have been assigned to one of the various types of memory available on the graphics processing unit based on the characteristics of the memory type and upon the type of memory access.

Referring now to FIG. 4, a flow diagram of a method 400 for performing memory-aware matrix factorization on a graphics processing unit in accordance with an exemplary embodiment is shown. As shown at block 402, the method 400 includes determining one or more types of memory on the graphics processing unit. In exemplary embodiments, the one or more types of memory may include registers, cache and global memory, such as DRAM. Next, as shown at block 404, the method 400 includes determining one or more characteristics of each of the one or more types of memory. In exemplary embodiments, the characteristics may include, but are not limited to, size, access latency, read/write permissions, and the like. In exemplary embodiments, the cache may be divided into shared memory and texture memory, wherein the texture memory is a cache memory that is read-only. In exemplary embodiments, the texture memory is used to store cached entries from a global memory. In exemplary embodiments, the shared memory may not be visible across kernels (i.e., GPU device functions). Next, as shown at block 406, the method 400 includes assigning each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics. In exemplary embodiments, the assignment of memory accesses to the memory types is configured to reduce discontiguous memory access and/or to cache hotspot, or frequently accessed, variables. In exemplary embodiments, the each of the memory accesses have one or more attributes that include, but are not limited to, a frequency that a stored variable is accessed and a contiguousness that accessed data is stored in the memory. The assignment of the memory accesses to the memory types is configured to align the attributes of the memory accesses with the characteristics of the memory types. The method 400 also includes executing the matrix factorization algorithm on the graphics processing unit, as shown at block 408.

The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.

Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.

Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.

These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.

The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions. 

1-8. (canceled)
 9. A computer program product for performing memory-aware matrix factorization on a graphics processing unit, the computer program product comprising: a non-transitory storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising: determining one or more types of memory on the graphics processing unit; determining one or more characteristics of each of the one or more types of memory; assigning each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics; and executing the matrix factorization algorithm on the graphics processing unit.
 10. The computer program product of claim 9, wherein the assignment of the plurality of memory accesses is configured to reduce discontiguous memory access.
 11. The computer program product of claim 9, wherein the one or more types of memory include a register memory, a cache memory and a global memory.
 12. The computer program product of claim 11, wherein the assignment of the plurality of memory accesses is configured to store hotspot variables in the cache memory.
 13. The computer program product of claim 11, wherein the cache memory includes a shared memory and a texture memory, wherein the texture memory is read-only.
 14. The computer program product of claim 9, wherein the characteristics include at least one of a memory size, an access latency, and a read/write permission.
 15. The computer program product of claim 13, wherein the texture memory is used to store cached entries from the global memory.
 16. The computer program product of claim 13, wherein the texture memory is used to cache read-only entries from the global memory.
 17. A graphics processing unit for performing memory-aware matrix factorization, comprising: a processor in communication with one or more types of memory, the processor configured to: determine the one or more types of memory on the graphics processing unit; determine one or more characteristics of each of the one or more types of memory; assign each of a plurality of memory accesses of a matrix factorization algorithm to one of the one or more types of memory based on the one or more characteristics; and execute the matrix factorization algorithm on the graphics processing unit.
 18. The graphics processing unit of claim 17, wherein the assignment of the plurality of memory accesses is configured to reduce discontiguous memory access.
 19. The graphics processing unit of claim 17, wherein the one or more types of memory include a register memory, a cache memory and a global memory.
 20. The graphics processing unit of claim 18, wherein the assignment of the plurality of memory accesses is configured to store hotspot variables in the cache memory. 